<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>$Title$</title>
  </head>
  <body>

<%@include file="common/header.jsp"%>

  
<%--  JSP表达式
 作用：用来将程序输出到客户端
 <%= 变量或表达式%>
 --%>
  <%= new java.util.Date()%>
<%--  这将来转换成java文件，write时就会自动调用toString方法--%>


  <%
    int sum=0;
    for (int i = 0; i <= 100; i++) {
      sum+=i;
    }
    out.println("<h1>Sum="+sum+"</h1>");

  %>

  <%
    int x = 10;
    for (int i = 0; i < 10; i++) {
  %>
  <h1></h1>
  <%
      out.println(x);
    }
  %>


  <%!
    static {
      System.out.println("loading");
    }
    public void test(){
      System.out.println("在Jspservice方法外部");
    }
  %>

  <%
    int y = 1/0;
  %>

  </body>
</html>
